package com.software.questioncenter.exception;

import com.software.questioncenter.domain.Result;
import com.software.questioncenter.utils.ResultUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Author: wjx
 * Description: 项目自定义异常的处理器 当抛出异常 跳到这里处理
 */
@RestControllerAdvice
public class BizExceptionHandler {

    @ExceptionHandler(BizException.class)
    public Result handlerException(BizException e){
        return ResultUtil.error("500", e.getMessage(), null);
    }

}
